import React, { Component } from 'react'
import { HashRouter as Router, Route, Link } from 'react-router-dom'

class Product extends Component {
  render() {
    console.log(this.props)
    return <h1>Product组件{this.props.match.params.id}</h1>
  }
}

export default class App extends Component {
  render() {
    return (
      <div>
        <Router>
          <Link to='/product/123'>产品</Link>
          <Route path='/product/:id' component={Product}></Route>
        </Router>
      </div>
    )
  }
}
